package main

import "fmt"

func main() {
	var userList = map[string]map[string]string{
		"root":{"password":"123456", "tel":"158xxxxxxxx"},
		"admin":{"password":"123456", "tel":"158xxxxxxxx"},
		"xiaoming":{"password":"123456", "tel":"158xxxxxxxx"}}
	var username string
	var password string
	for{
		fmt.Println("请输入用户名和密码:")
		fmt.Scan(&username, &password)
		value, err := userList[username]
		if err == true && userList[username]["password"] == password{
			fmt.Printf("用户名和密码正确,%s的手机号码是%s",username,value["tel"])
			break
		}else{
			fmt.Println("用户名或密码出错，请重新输入\n")
		}

	}


}
